import tool from 'src/util/tool';

const for_mutation = store => {
    // called when the store is initialized
    store.subscribe((mutation, state) => {
        let {type,payload} = mutation;
        let b = ['global/setEditVoContact', 'global/setEditVo'].contains(type);
        if(b) {
            // tool.cl(mutation);
            if (Object.keys(payload).length == 0) {
                state.edit.voErrors = {}
            }
        }
        // called after every mutation.
        // The mutation comes in the format of `{ type, payload }`.
    })
}

export default [
    for_mutation
];